/*
 * OrdenPlatilloPK.java
 *
 * Created on 16 de octubre de 2007, 06:07 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * Primary Key class OrdenPlatilloPK for entity class OrdenPlatillo
 * 
 * @author Fanny Paola
 */
@Embeddable
public class OrdenPlatilloPK implements Serializable {

    @Column(name = "idOrden", nullable = false)
    private int idOrden;

    @Column(name = "idPlatillo", nullable = false)
    private int idPlatillo;
    
    /** Creates a new instance of OrdenPlatilloPK */
    public OrdenPlatilloPK() {
    }

    /**
     * Creates a new instance of OrdenPlatilloPK with the specified values.
     * @param idPlatillo the idPlatillo of the OrdenPlatilloPK
     * @param idOrden the idOrden of the OrdenPlatilloPK
     */
    public OrdenPlatilloPK(int idPlatillo, int idOrden) {
        this.idPlatillo = idPlatillo;
        this.idOrden = idOrden;
    }

    /**
     * Gets the idOrden of this OrdenPlatilloPK.
     * @return the idOrden
     */
    public int getIdOrden() {
        return this.idOrden;
    }

    /**
     * Sets the idOrden of this OrdenPlatilloPK to the specified value.
     * @param idOrden the new idOrden
     */
    public void setIdOrden(int idOrden) {
        this.idOrden = idOrden;
    }

    /**
     * Gets the idPlatillo of this OrdenPlatilloPK.
     * @return the idPlatillo
     */
    public int getIdPlatillo() {
        return this.idPlatillo;
    }

    /**
     * Sets the idPlatillo of this OrdenPlatilloPK to the specified value.
     * @param idPlatillo the new idPlatillo
     */
    public void setIdPlatillo(int idPlatillo) {
        this.idPlatillo = idPlatillo;
    }

    /**
     * Returns a hash code value for the object.  This implementation computes 
     * a hash code value based on the id fields in this object.
     * @return a hash code value for this object.
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int)idPlatillo;
        hash += (int)idOrden;
        return hash;
    }

    /**
     * Determines whether another object is equal to this OrdenPlatilloPK.  The result is 
     * <code>true</code> if and only if the argument is not null and is a OrdenPlatilloPK object that 
     * has the same id field values as this object.
     * @param object the reference object with which to compare
     * @return <code>true</code> if this object is the same as the argument;
     * <code>false</code> otherwise.
     */
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdenPlatilloPK)) {
            return false;
        }
        OrdenPlatilloPK other = (OrdenPlatilloPK)object;
        if (this.idPlatillo != other.idPlatillo) return false;
        if (this.idOrden != other.idOrden) return false;
        return true;
    }

    /**
     * Returns a string representation of the object.  This implementation constructs 
     * that representation based on the id fields.
     * @return a string representation of the object.
     */
    @Override
    public String toString() {
        return "data.OrdenPlatilloPK[idPlatillo=" + idPlatillo + ", idOrden=" + idOrden + "]";
    }
    
}
